db_constraints.utils.meta

The meta module contains: $(TOC opAAKey) $(TOC GetUniqueConstraintStructNames) $(TOC GetMembersWithUDA) $(TOC hasMembersWithUDA) $(TOC createConstraintStructs) $(TOC GetForeignKeys) $(TOC hasForeignKeys) $(TOC GetForeignKeyRefTable) $(TOC GetDefault) $(TOC hasDefault) $(TOC createForeignKeyPropertyConverter) $(TOC createForeignKeyProperties) $(TOC createForeignKeyCheckExceptions) $(TOC createForeignKeyChanged) $(TOC hasExclusionConstraints) $(TOC GetExclusionConstraints)

Members

Mixin templates

opAAKey
mixintemplate opAAKey(T)

Used in KeyedItem for the generated structs. This allows the struct to be used as a key in an associative array.

Templates

GetDefault
template GetDefault(ClassName, string memberName)

Gets the value for ClassName.memberName inside of @Default!(value) if memberName has @Default!(value)

GetExclusionConstraints
template GetExclusionConstraints(ClassName)

Gets all of the $(WIKI constraints, ExclusionConstraint) that ClassName is attributed with. If the exclusion constraint name is left blank then the default name is "exc_" ~ ClassName.

GetForeignKeyRefTable
template GetForeignKeyRefTable(ClassName)

Gets all of the referenced foreign keys for ClassName.

GetForeignKeys
template GetForeignKeys(ClassName)

Gets all of the $(WIKI constraints, ForeignKey) that ClassName is attributed with. If the foreign key name is left blank then the default name is "fk_" ~ ClassName ~ "__" ~ referencedClassName.

GetMembersWithUDA
template GetMembersWithUDA(ClassName, attribute)

Gets the properties of ClassName marked with @attribute. If the attribute is PrimaryKeyColumn then it also confirms the property has NotNull.

GetUniqueConstraintStructNames
template GetUniqueConstraintStructNames(ClassName)

Gets the names given to the different UniqueConstraints for ClassName. The UniqueConstraintColumns are usually put on getters and setters.

createConstraintStructs
template createConstraintStructs(ClassName, string ClusteredIndexAttributeName)
Undocumented in source.
createForeignKeyChanged
template createForeignKeyChanged(ClassName)

Creates the foreign keys update rule and delete rule property and sets them to the foreign key attribute property. It also creates the function that will be attached to the foreign key when it is associated. This is where the update rule and delete rule are used since the referenced class will emit what changed and to which item.

createForeignKeyCheckExceptions
template createForeignKeyCheckExceptions(ClassName)

Creates the foreign key check exceptions by seeing if the foreign key has been associated and whether or not the referenced table has a matching record.

createForeignKeyProperties
template createForeignKeyProperties(ClassName)

Creates the foreign key properties that will be used in KeyedCollection. It loops over all of the foreign key attributes for ClassName and creates a write-only property for each referenced class by using the class' name in lower case. There is a static assert that makes sure the lower case class name does not equal the class name. This would result in name collisions and is not conforming to the D style.

createForeignKeyPropertyConverter
template createForeignKeyPropertyConverter(ClassName)

Creates the foreign key properties inside of KeyedItem that convert the keyed items properties into the necessary foreign key clustered index.

hasDefault
template hasDefault(ClassName, string memberName)

Confirms ClassName.memberName has @Default!(value)

hasExclusionConstraints
template hasExclusionConstraints(ClassName)

Confirms ClassName has exclusion constraints.

hasForeignKeys
template hasForeignKeys(ClassName)

Confirms ClassName has foreign keys.

hasMembersWithUDA
template hasMembersWithUDA(ClassName, attribute)

Confirms there are members in ClassName with @attribute.

Meta

License

$(GPL2)

Authors

Matthew Armbruster

Source: $(SRC $(SRCFILENAME))